package cn.cvs.biz;

import cn.cvs.dao.AuctionUserDao;
import cn.cvs.dao.AuctionUserDaoImpl;
import cn.cvs.pojo.AuctionUser;

import java.sql.SQLException;

public class AuctionUserBizImpl implements AuctionUserBiz{

    AuctionUserDao userDao = new AuctionUserDaoImpl();

    @Override
    public AuctionUser login(AuctionUser loginuser) throws SQLException {
        //2种角色登录
        AuctionUser user  = userDao.login(loginuser);
        if (null!=user){
            //admin   //普通用户
            if (user.getUserIsAdmin() == loginuser.getUserIsAdmin()){
                return user;
            }
        }
        return null;
    }
}
